package mrusanov.view

import mrusanov.images.Image
import mrusanov.util.ImageUtil
import mrusanov.sounds.Sound

class MovingSpriteEffectInfo(val name:String, images:Map[MovingSpriteEffectStage, Vector[Image]],
                             val distance:Double, val moveEndSound:Option[Sound])
  extends GraphicEffectInfo {

  private lazy val flippedImages = images map(kv => (kv._1, ImageUtil.flipImagesVertically(kv._2)))

  def images(up:Boolean):Map[MovingSpriteEffectStage, Vector[Image]] = {
    if (up) images
    else flippedImages
  }
}